-- @owner: wan005
-- @date: 2025/6/11
-- @testpoint: 【A兼容性-支持自定义subtype】subtype类型为已经存在的record类型，并在存储过程中作为入参，且入参模式为普通模式

--pre1:连接A库执行
@conn PrimaryDbAmode;

--step1:创建package；expect:成功
create or replace package p1_subtype_060 authid definer is
type r_type_1 is record (f varchar2(5) := 'abcde');
subtype r_type_2 is r_type_1;
end p1_subtype_060;
/

--step2:创建procedure；expect:成功
create extension if not exists gms_output;
create or replace procedure pro_subtype_060 (
x inout p1_subtype_060.r_type_1,
y inout p1_subtype_060.r_type_2,
z out varchar2)
authid current_user is
begin
gms_output.put_line('x.f is ' || nvl(x.f,'null'));
gms_output.put_line('y.f is ' || nvl(y.f,'null'));
gms_output.put_line('z is ' || nvl(z,'null'));
end;
/

--step3:调用存储过程；expect:成功
declare
r1 p1_subtype_060.r_type_1;
r2 p1_subtype_060.r_type_2;
s varchar2(5) := 'fghij';
begin
pro_subtype_060(r1, r2, s);
end;
/

--step4:清理环境；expect:成功
drop package p1_subtype_060;